<template>
    <div class="app-container">
      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
        <el-form-item label="供应商" prop="supplierId">
          <el-select v-model="queryParams.supplierId" filterable placeholder="请选择">
            <el-option
              v-for="item in suppliers"
              :key="item.supplierManagementId"
              :label="item.supplierName"
              :value="item.supplierManagementId">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="品牌" prop="brand" >
          <el-input
            v-model="queryParams.brand"
            placeholder="请输入品牌"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="商品分类" prop="status">
          <el-select v-model="queryParams.cartType" placeholder="商品分类" clearable>
            <el-option
              v-for="dict in dict.type.service_product_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>
      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button
            type="primary"
            plain
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
            v-hasPermi="['service:product:add']"
          >新增</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="success"
            plain
            icon="el-icon-edit"
            size="mini"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['service:product:edit']"
          >修改</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="danger"
            plain
            icon="el-icon-delete"
            size="mini"
            :disabled="multiple"
            @click="handleDelete"
            v-hasPermi="['service:product:remove']"
          >删除</el-button>
        </el-col>
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>
      <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="供应商" align="center" width="100" prop="supplierName" />
        <el-table-column label="商品编号" align="center" width="150" prop="commodityNumber" />
        <el-table-column label="品牌" align="center" width="100" prop="brand" />
        <el-table-column label="规格" align="center" width="150" prop="specifications" />
        <el-table-column label="标题" align="center" width="150" prop="cartTitle" />
        <el-table-column label="原价" align="center" width="100" prop="cartPriceAgo" />
        <el-table-column label="卖价" align="center" width="100" prop="cartPrice" />
        <el-table-column label="商品分类" align="center" width="150" prop="cartType" />
        <el-table-column label="图片" align="center"  width="150">
          <template slot-scope="scope">
            <el-image style="width: 100px; height: 100px" :src=" api + scope.row.cartImg"/>
          </template>
        </el-table-column>
        <el-table-column label="图片1" align="center" width="150">
          <template slot-scope="scope">
            <el-image style="width: 100px; height: 100px" :src=" api + scope.row.cartImg1"/>
          </template>
        </el-table-column>
        <el-table-column label="图片2" align="center" width="150" >
          <template slot-scope="scope">
            <el-image style="width: 100px; height: 100px" :src=" api + scope.row.cartImg2"/>
          </template>
        </el-table-column>
        <el-table-column label="图片3" align="center" width="150">
          <template slot-scope="scope">
            <el-image style="width: 100px; height: 100px" :src=" api + scope.row.cartImg3"/>
          </template>
        </el-table-column>
        <el-table-column label="图片4" align="center" width="150" >
          <template slot-scope="scope">
            <el-image style="width: 100px; height: 100px" :src=" api + scope.row.cartImg4"/>
          </template>
        </el-table-column>
        <el-table-column label="图片5" align="center" width="150" >
          <template slot-scope="scope">
            <el-image style="width: 100px; height: 100px" :src=" api + scope.row.cartImg5" />
          </template>
        </el-table-column>
        <el-table-column label="创建人" align="center" width="100" prop="createBy" />
        <el-table-column label="创建时间" align="center" width="200" prop="createTime" />
        <el-table-column label="更新时间" align="center" width="200" prop="updateTime" />
        <el-table-column label="更新人" align="center" width="100" prop="updateBy" />
        <el-table-column fixed="right" label="操作" width="200" align="center" class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['service:product:edit']"
            >修改</el-button>
            <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleEditImg(scope.row)"
              v-hasPermi="['service:product:img']"
            >图片上传</el-button>
            <el-button
              size="mini"
              type="text"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['service:product:remove']"
            >删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
      <!-- 添加或修改岗位对话框 -->
      <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
        <el-form ref="form" :model="form" :rules="rules" label-width="80px">
          <el-form-item label="供应商" prop="supplierId">
            <el-select v-model="form.supplierId" filterable placeholder="请选择">
              <el-option
                v-for="item in suppliers"
                :key="item.supplierManagementId"
                :label="item.supplierName"
                :value="item.supplierManagementId">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="商品编号" prop="commodityNumber">
            <el-input v-model="form.commodityNumber" placeholder="请输入商品编号" />
          </el-form-item>
          <el-form-item label="品牌" prop="brand">
            <el-input v-model="form.brand" placeholder="请输入品牌" />
          </el-form-item>
          <el-form-item label="规格" prop="specifications">
            <el-input v-model="form.specifications" placeholder="请输入规格" />
          </el-form-item>
          <el-form-item label="标题" prop="cartTitle">
            <el-input v-model="form.cartTitle" placeholder="请输入标题" />
          </el-form-item>
          <el-form-item label="描述" prop="cartDescription">
            <el-input v-model="form.cartDescription" placeholder="请输入描述" />
          </el-form-item>
          <el-form-item label="原价" prop="cartPriceAgo">
            <el-input  t_value="" o_value="" onkeypress="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/))this.value=this.t_value;else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" onkeyup="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/))this.value=this.t_value;else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" onblur="if(!this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?|\.\d*?)?$/))this.value=this.o_value;else{if(this.value.match(/^\.\d+$/))this.value=0+this.value;if(this.value.match(/^\.$/))this.value=0;this.o_value=this.value}"
              v-model="form.cartPriceAgo" placeholder="请输入原价"/>
          </el-form-item>
          <el-form-item label="卖价" prop="cartPrice">
            <el-input type=text t_value="" o_value="" onkeypress="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/))this.value=this.t_value;else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" onkeyup="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/))this.value=this.t_value;else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" onblur="if(!this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?|\.\d*?)?$/))this.value=this.o_value;else{if(this.value.match(/^\.\d+$/))this.value=0+this.value;if(this.value.match(/^\.$/))this.value=0;this.o_value=this.value}"
            v-model="form.cartPrice" placeholder="请输入卖价" />
          </el-form-item>
          <el-form-item label="商品分类" prop="status">
            <el-select v-model="form.cartType" placeholder="商品分类" clearable>
              <el-option
                v-for="dict in dict.type.service_product_type"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="正文" prop="cartContent">
            <el-input v-model="form.cartContent" placeholder="请输入正文" type="textarea"/>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </el-dialog>
      <el-dialog title="编辑图片" :visible.sync="imgOpen" width="1600px" append-to-body>
        <el-form ref="form" :model="imgForm" label-width="80px">
          <el-row >
            <div align="center">
              <el-image
                style="width: 500px; height: 500px"
                :src="srcList[0]"
                :preview-src-list="srcList">
              </el-image>
            </div>
          </el-row>
          <el-row >
            <div>
            <el-col :span="4.5">
              <el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
                <vue-cropper
                  :style="{width:'250px ',height:'250px'}"
                  ref="cropper"
                  :img="options.img"
                  :info="true"
                  :autoCrop="options.autoCrop"
                  :autoCropWidth="options.autoCropWidth"
                  :autoCropHeight="options.autoCropHeight"
                  :fixedBox="options.fixedBox"
                  :outputType="options.outputType"
                  @realTime="realTime"
                  v-if="visible"/>
              </el-upload>
            </el-col>
            <el-col :span="4.5">
              <el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload1">
                <vue-cropper
                  :style="{width:'250px ',height:'250px'}"
                  ref="cropper"
                  :img="options1.img"
                  :info="true"
                  :autoCrop="options1.autoCrop"
                  :autoCropWidth="options1.autoCropWidth"
                  :autoCropHeight="options1.autoCropHeight"
                  :fixedBox="options1.fixedBox"
                  :outputType="options1.outputType"
                  @realTime="realTime"
                  v-if="visible"/>
              </el-upload>
            </el-col>
            <el-col :span="4.5">
              <el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload2">
                <vue-cropper
                  :style="{width:'250px ',height:'250px'}"
                  ref="cropper"
                  :img="options2.img"
                  :info="true"
                  :autoCrop="options2.autoCrop"
                  :autoCropWidth="options2.autoCropWidth"
                  :autoCropHeight="options2.autoCropHeight"
                  :fixedBox="options2.fixedBox"
                  :outputType="options2.outputType"
                  @realTime="realTime"
                  v-if="visible"/>
              </el-upload>
            </el-col>
            <el-col :span="4.5">
              <el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload3">
                <vue-cropper
                  :style="{width:'250px ',height:'250px'}"
                  ref="cropper"
                  :img="options3.img"
                  :info="true"
                  :autoCrop="options3.autoCrop"
                  :autoCropWidth="options3.autoCropWidth"
                  :autoCropHeight="options3.autoCropHeight"
                  :fixedBox="options3.fixedBox"
                  :outputType="options3.outputType"
                  @realTime="realTime"
                  v-if="visible"/>
              </el-upload>
            </el-col>
            <el-col :span="4.5">
              <el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload4">
                <vue-cropper
                  :style="{width:'250px ',height:'250px'}"
                  ref="cropper"
                  :img="options4.img"
                  :info="true"
                  :autoCrop="options4.autoCrop"
                  :autoCropWidth="options4.autoCropWidth"
                  :autoCropHeight="options4.autoCropHeight"
                  :fixedBox="options4.fixedBox"
                  :outputType="options4.outputType"
                  @realTime="realTime"
                  v-if="visible"/>
              </el-upload>
            </el-col>
            <el-col :span="4.5">
              <el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload5">
                <vue-cropper
                  :style="{width:'250px ',height:'250px'}"
                  ref="cropper"
                  :img="options5.img"
                  :info="true"
                  :autoCrop="options5.autoCrop"
                  :autoCropWidth="options5.autoCropWidth"
                  :autoCropHeight="options5.autoCropHeight"
                  :fixedBox="options5.fixedBox"
                  :outputType="options5.outputType"
                  @realTime="realTime"
                  v-if="visible"/>
              </el-upload>
            </el-col>
            </div>
          </el-row>
        </el-form>
        <div align="center">
          <el-button type="primary"  size="small" @click="upload()">提 交</el-button>
        </div>
      </el-dialog>
    </div>
</template>

<script>
  import { list, add, update, del, get, uploadImg } from "@/api/service/product"
  import {  getSelection } from "@/api/service/supplier"
  import { VueCropper } from "vue-cropper";
  export default {
    components:{VueCropper},
    name: 'index',
    dicts: ['service_product_type'],
    data() {
      return {
        api:process.env.VUE_APP_BASE_URL,
        srcList:[],
        // 遮罩层
        loading: true,
        supplierIds:[],
        // 是否显示cropper
        visible: true,
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        productList:[],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        //编辑图片
        imgOpen:false,
        options: {
          img:'',  //裁剪图片的地址
          autoCrop: true,             // 是否默认生成截图框
          autoCropWidth: 300,         // 默认生成截图框宽度
          autoCropHeight: 300,        // 默认生成截图框高度
          fixedBox: true,             // 固定截图框大小 不允许改变
          outputType:"png",           // 默认生成截图为PNG格式
          filename: 'avatar'          // 文件名称
        },
        options1: {
          img:'',  //裁剪图片的地址
          autoCrop: true,             // 是否默认生成截图框
          autoCropWidth: 300,         // 默认生成截图框宽度
          autoCropHeight: 300,        // 默认生成截图框高度
          fixedBox: true,             // 固定截图框大小 不允许改变
          outputType:"png",           // 默认生成截图为PNG格式
          filename: 'avatar'          // 文件名称
        },
        options2: {
          img:'',  //裁剪图片的地址
          autoCrop: true,             // 是否默认生成截图框
          autoCropWidth: 300,         // 默认生成截图框宽度
          autoCropHeight: 300,        // 默认生成截图框高度
          fixedBox: true,             // 固定截图框大小 不允许改变
          outputType:"png",           // 默认生成截图为PNG格式
          filename: 'avatar'          // 文件名称
        },
        options3: {
          img:'',  //裁剪图片的地址
          autoCrop: true,             // 是否默认生成截图框
          autoCropWidth: 300,         // 默认生成截图框宽度
          autoCropHeight: 300,        // 默认生成截图框高度
          fixedBox: true,             // 固定截图框大小 不允许改变
          outputType:"png",           // 默认生成截图为PNG格式
          filename: 'avatar'          // 文件名称
        },
        options4: {
          img:'',  //裁剪图片的地址
          autoCrop: true,             // 是否默认生成截图框
          autoCropWidth: 300,         // 默认生成截图框宽度
          autoCropHeight: 300,        // 默认生成截图框高度
          fixedBox: true,             // 固定截图框大小 不允许改变
          outputType:"png",           // 默认生成截图为PNG格式
          filename: 'avatar'          // 文件名称
        },
        options5: {
          img:'',  //裁剪图片的地址
          autoCrop: true,             // 是否默认生成截图框
          autoCropWidth: 300,         // 默认生成截图框宽度
          autoCropHeight: 300,        // 默认生成截图框高度
          fixedBox: true,             // 固定截图框大小 不允许改变
          outputType:"png",           // 默认生成截图为PNG格式
          filename: 'avatar'          // 文件名称
        },
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          supplierId:undefined,
          brand:'',
          cartTitle:'',
          cartType:''
        },
        productInformationIds: [],
        suppliers: [],
        imgForm: {
          productInformationId:undefined
        },
        // 表单参数
        form: {
          productInformationId:undefined,
          commodityNumber:'',
          specifications:'',
          cartDescription:'',
          cartContent:'',
          cartPriceAgo:'',
          cartPrice:''
        },
        dataList:[],
        rules:{},
        url:''
      }
    },
    created () {
      this.getSuppliers()
      this.getList()
    },
    methods:{
      upload(){
        let formData = new FormData();
        formData.append("productInformationId",this.imgForm.productInformationId)
        formData.append("img",this.base64ToBlob(this.options.img,'image/png'),this.options.outputType)
        formData.append("img1",this.base64ToBlob(this.options1.img,'image/png'),this.options1.outputType)
        formData.append("img2",this.base64ToBlob(this.options2.img,'image/png'),this.options2.outputType)
        formData.append("img3",this.base64ToBlob(this.options3.img,'image/png'),this.options3.outputType)
        formData.append("img4",this.base64ToBlob(this.options4.img,'image/png'),this.options4.outputType)
        formData.append("img5",this.base64ToBlob(this.options5.img,'image/png'),this.options5.outputType)
        uploadImg(formData).then(() => {
          this.$modal.msgSuccess("上传成功");
          this.imgOpen = false;
          this.getList();
        })
      },
      urlToBase64(imageUrl){
         return   new Promise((resolve, reject) => {
          let canvas = document.createElement('canvas')
          const ctx = canvas.getContext('2d')
          let img = new Image()
          img.crossOrigin = 'Anonymous' // 解决Canvas.toDataURL 图片跨域问题
          img.src = imageUrl
          img.onload = function() {
            canvas.height = img.height
            canvas.width = img.width
            ctx.fillStyle = '#fff' // canvas背景填充颜色默认为黑色
            ctx.fillRect(0,0,img.width,img.height)
            ctx.drawImage(img, 0, 0) // 参数可自定义
            const dataURL = canvas.toDataURL('image/jpeg', 1) // 获取Base64编码
            resolve(dataURL)
            canvas = null // 清除canvas元素
            img = null // 清除img元素
          }
          img.onerror = function() {
            reject(new Error('Could not load image at ' + imageUrl))
          }
        })
      },
      base64ToBlob(base64, mimeType) {
        const byteCharacters = atob(base64.split(',')[1]);
        const byteNumbers = new Array(byteCharacters.length);
        for (let i = 0; i < byteCharacters.length; i++) {
          byteNumbers[i] = byteCharacters.charCodeAt(i);
        }
        const byteArray = new Uint8Array(byteNumbers);
        return new Blob([byteArray], { type: mimeType });
      },
      beforeUpload(file) {
        if (file.type.indexOf("image/") == -1) {
          this.$modal.msgError("文件格式错误，请上传图片类型,如：JPG，PNG后缀的文件。");
        }else{
          const reader = new FileReader();
          reader.readAsDataURL(file);
          reader.onload = () => {
            this.options.img =  reader.result;
          };
        }
      },
      beforeUpload1(file) {
        if (file.type.indexOf("image/") == -1) {
          this.$modal.msgError("文件格式错误，请上传图片类型,如：JPG，PNG后缀的文件。");
        }else{
          const reader = new FileReader();
          reader.readAsDataURL(file);
          reader.onload = () => {
            this.options1.img =  reader.result;
          };
        }
      },
      beforeUpload2(file) {
        if (file.type.indexOf("image/") == -1) {
          this.$modal.msgError("文件格式错误，请上传图片类型,如：JPG，PNG后缀的文件。");
        }else{
          const reader = new FileReader();
          reader.readAsDataURL(file);
          reader.onload = () => {
            this.options2.img =  reader.result;
          };
        }
      },
      beforeUpload3(file) {
        if (file.type.indexOf("image/") == -1) {
          this.$modal.msgError("文件格式错误，请上传图片类型,如：JPG，PNG后缀的文件。");
        }else{
          const reader = new FileReader();
          reader.readAsDataURL(file);
          reader.onload = () => {
            this.options3.img =  reader.result;
          };
        }
      },
      beforeUpload4(file) {
        if (file.type.indexOf("image/") == -1) {
          this.$modal.msgError("文件格式错误，请上传图片类型,如：JPG，PNG后缀的文件。");
        }else{
          const reader = new FileReader();
          reader.readAsDataURL(file);
          reader.onload = () => {
            this.options4.img =  reader.result;
          };
        }
      },
      beforeUpload5(file) {
        if (file.type.indexOf("image/") == -1) {
          this.$modal.msgError("文件格式错误，请上传图片类型,如：JPG，PNG后缀的文件。");
        }else{
          const reader = new FileReader();
          reader.readAsDataURL(file);
          reader.onload = () => {
            this.options5.img =  reader.result;
          };
        }
      },
      // 实时预览
      realTime(data) {
        this.previews = data;
      },
      // 覆盖默认的上传行为
      requestUpload(){},
      handleEditImg(row){
        this.resetImg();
        this.imgForm.productInformationId = row.productInformationId
        this.srcList = [ this.api + row.cartImg ,this.api + row.cartImg1 ,this.api + row.cartImg2, this.api + row.cartImg3, this.api + row.cartImg4,this.api + row.cartImg5]
        this.urlToBase64(this.api + row.cartImg).then(res=>{
          this.options.img = res
        })
        this.urlToBase64(this.api + row.cartImg1).then(res=>{
          this.options1.img = res
        })
        this.urlToBase64(this.api + row.cartImg2).then(res=>{
          this.options2.img = res
        })
        this.urlToBase64(this.api + row.cartImg3).then(res=>{
          this.options3.img = res
        })
        this.urlToBase64(this.api + row.cartImg4).then(res=>{
          this.options4.img = res
        })
        this.urlToBase64(this.api + row.cartImg5).then(res=>{
          this.options5.img = res
        })
        this.imgOpen = true;
      },
      resetImg(){
        this.resetForm("imgForm");
      },
      getSuppliers(){
        getSelection().then(res=>{
          this.suppliers = res .data
        })
      },
      getList() {
        this.loading = true;
        list(this.queryParams).then(res =>{
          this.dataList = res.rows;
          this.total = res.total
          this.loading = false;
        })
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.productInformationIds = selection.map(item => item.productInformationId)
        this.single = selection.length!=1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "添加商品信息";
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.reset();
        const productInformationId = row.productInformationId || this.productInformationIds
        get(productInformationId).then(res =>{
          this.form = res.data;
          this.open = true;
          this.title = "修改商品";
        })
      },
      /** 提交按钮 */
      submitForm: function() {
        this.$refs["form"].validate(valid => {
          if (valid){
            if (this.form.productInformationId != undefined) {
              update(this.form).then(()=>{
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              })
            }else{
              add(this.form).then(() =>{
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
              })
            }
          }
        });
      },
      handleDelete(row) {
        const productInformationIds = row.productInformationId || this.productInformationIds;
        this.$modal.confirm('是否确认删除这些商品？'+productInformationIds).then(function() {
          return del(productInformationIds)
        }).then(() =>{
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(()=>{})
        }
    }
  }
</script>

<style scoped>

</style>
